<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@  taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html lang="en">
<%@ include file="common/head.jsp"%>

<body class="fix-header fix-sidebar">

	<!-- Preloader - style you can find in spinners.css -->
	<div class="preloader">
		<svg class="circular" viewBox="25 25 50 50">
				<circle class="path" cx="50" cy="50" r="20" fill="none"
				stroke-width="2" stroke-miterlimit="10" /> </svg>
	</div>
	<!-- Main wrapper  -->
	<div id="main-wrapper">
		<!-- header header  -->
		<%@ include file="common/header.jsp"%>
		<!-- End header header -->
		<!-- Left Sidebar  -->
		<%@ include file="common/nav.jsp"%>
		<!-- End Left Sidebar  -->
		<!-- Page wrapper  -->
		<div class="page-wrapper">
			<!-- 锐高软件 -->
			<%@ include file="../common/ruigao.jsp"%>

			<!--
                    	作者：offline
                    	时间：2018-03-26
                    	描述：查看公司列表
                    -->
			<div class="container-fluid">
				<!-- Start Page Content -->
				<div class="row justify-content-center">
					<div class="col-12">
						<div class="card">
							<div class="card-body">
								<div class="card-content">
									<!-- Left sidebar -->
									<div class="inbox-leftbar">
										<a class="btn btn-danger btn-block waves-effect waves-light"
											href="${pageContext.request.contextPath}/company_add.jsp">
											<font style="vertical-align: inherit;"> <font
												style="vertical-align: inherit;">创办公司</font>
										</font>
										</a>

									</div>

								</div>
								<!-- End Left sidebar -->

								<div>

									<div role="toolbar" class="">
										<div class="btn-group">
											<button class="btn btn-light waves-effect" type="button">
												<i class="mdi mdi-archive font-18 vertical-middle"></i>
											</button>
											<button class="btn btn-light waves-effect" type="button">
												<i class="mdi mdi-alert-octagon font-18 vertical-middle"></i>
											</button>
											<button class="btn btn-light waves-effect" type="button">
												<i class="mdi mdi-delete-variant font-18 vertical-middle"></i>
											</button>
										</div>

										
									</div>



									<div class="mt-4">
										<br />
										<table class="table">
											<thead>
												<tr>
													<th>公司名称</th>
													<th>创始人</th>
													<th>成立时间</th>
													<th>操作</th>
												</tr>
											</thead>
											<tbody>

												<%@ include file="listall/companylist.jsp"%>
												

											</tbody>
										</table>
									</div>
									<!-- panel body -->

									<!-- panel -->

								</div>

							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!-- End Container fluid  -->
	<!-- footer -->
	<%@ include file="common/footer.jsp"%>
	<!-- End footer -->
	<!-- End Page wrapper  -->
	<%@ include file="common/js.jsp"%>
	<!--
        	作者：offline
        	时间：2018-04-09
        	描述：点击删除按钮弹窗
        -->
    
	<script type="text/javascript">
		$(function() {
			//点击删除
			$(".del").click(function() {
				var companyid = $(this).val();
				$("#selectcompan").val("selectdel");
				var selectcompan = $("#selectcompan").val();
				swal({
					title :"您确定要解散该公司吗？",
					animation : "slide-from-top",
					showCancelButton : true,
					closeOnConfirm : false,
					cancelButtonText : "取消",
					confirmButtonText : "确定"
					},
					function(inputValue) {
						if(inputValue === false) return false;
							$.ajax({
								url : "selectcompany",
								type : "GET",
								data : {"selectcompan" : selectcompan,"companyid" : companyid},
								datatype : "JSON",
								success : function(data) {
								if (data) {
									swal({
										title : "操作成功,<span style='color:red'>已删除</span>该公司",
										html : true,
										type : "success",
										showCancelButton : false,
										showConfirmButton : true,
										confirmButtonText : "确定",
									},function(){
										location.reload();
									});
								}else{
									
								}
							},
							error : function(data) {
								swal({
									title : '操作失败！',
									type : 'error',
									confirmButtonText : '确定',
									closeOnConfirm : false
								});
							}
						});
					}
				);
			});
		});
	</script>
</body>

</html>